import { BASE_URL } from '@/settings'
import request from '@/utils/request'

export function listSalaryBills(){
  return request({
    url: `${BASE_URL}/hr/api/v1/salaryBills/listAll`
  })
}

// 查询员工工资条（按年月查询最新一次记录）
export function getSalaryBillRelationLast(data){
  return request({
    url: `${BASE_URL}/hr/api/v1/salaryBills/getSalaryBillRelationLast`,
    method: 'post',
    data
  })
}

// 查询员工工资表年月分组
export function salaryTableGroupByEmpId(data){
  return request({
    url: `${BASE_URL}/hr/api/v1/salaryTables/salaryTableGroupByEmpId`,
    method: 'get',
    data
  })
}
// 查询员工工资表年月分组相关
export function salaryTableGroupByMonthEmpId(data){
  return request({
    url: `${BASE_URL}/hr/api/v1/salaryTables/salaryTableGroupByMonthEmpId`,
    method: 'get',
    data
  })
}
// 查询工资条相关信息
export function getSalaryBillRelation(data){
  return request({
    url: `${BASE_URL}/hr/api/v1/salaryBills/getSalaryBillRelation`,
    method: 'get',
    data
  })
}

// 修改工资条
export function updateSalaryBills(data){
  return request({
    url: `${BASE_URL}/hr/api/v1/salaryBills`,
    method: 'put',
    data
  })
}